package com.klikmee.sms.core.base.communicator;

import com.klikmee.sms.core.base.exceptions.DeliveryReportNotResolvedException;
import com.klikmee.sms.core.model.OutgoingMessage;

/**
 * This component is responsible for resolving outgoing message that delivery
 * report is received for. Every provider has a different way of matching
 * delivery reports to messages.
 */
public interface DeliveryReport2MessageResolver {
	/**
	 * Delivery report is transfered to core via outgoing message object,
	 * containing just the minimal amount of delivery report data. This must be
	 * matched to the outgoing message actually sent to the user.
	 * 
	 * @param deliveryReport
	 *            delivery report data in form of {@link OutgoingMessage}
	 * @return the actual outgoing message matching that the delivery report is
	 *         received for
	 * @throws DeliveryReportNotResolvedException
	 *             in case when delivery report could not be resolved
	 */
	public OutgoingMessage resolve(DeliveryReport deliveryReport) throws DeliveryReportNotResolvedException;
}
